package com.ezjie.ielts.task;

import java.util.HashMap;
import java.util.Map;

import android.content.Context;

import com.ezjie.ielts.constant.Constants;
import com.ezjie.ielts.core.http.HttpAPI;
import com.ezjie.ielts.core.http.HttpRequestCallBack;
import com.ezjie.ielts.core.http.ServerInterfaceDefinition;

public class ListenSubjectsTask {

	private Context context;

	public ListenSubjectsTask(Context context) {
		this.context = context;
	}

	/**
	 * 获取阅读分类筛选科目
	 * 
	 * @param httpRequestCallBack
	 */
	public void doGetSubject(HttpRequestCallBack httpRequestCallBack) {

		HttpAPI.getInstance(context).doGetRequest(ServerInterfaceDefinition.LISTEN_SUBJECTS, null, httpRequestCallBack);
	}

	/**
	 * 根据id获取题目
	 * 
	 * @param type
	 * @param httpRequestCallBack
	 */
	public void getListenSubjectQuestion(String category_id, HttpRequestCallBack httpRequestCallBack) {
		Map<String, String> params = new HashMap<String, String>();
		params.put(Constants.PARAMS_CATEGORY_ID, category_id);

		HttpAPI.getInstance(context).doGetRequest(ServerInterfaceDefinition.OPT_LISTEN_CLASSIFY_QUESTION, params,
				httpRequestCallBack);
	}

}
